home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / PlainTalk Developer / Text-to-Speech / Installer Source / BuildMexicanSpanishTTS < prev    next >
Encoding:
Text File  |  1995-04-17  |  10.6 KB  |  286 lines  |  [TEXT/MPS ]

  1. #
  2. # Build the installer and disk set for Mexican Spanish Text-to-Speech.
  3. # This is for development testing only; this script is not used by
  4. # SCM for actual builds.
  5. #
  6. # There is an option, -s, to just rebuild the installer script without
  7. # processing all the files to be installed.  This option can only be used
  8. # if you have run this script previously without the -s option.  If you
  9. # make a change that affects anything besides the installer script (e.g.
  10. # change, add, delete, or move a file to be installed) you need to run
  11. # this build script without the -s option.
  12. #
  13. # Assumes that the files to be installed have all been built, and that
  14. # the installer source pieces have all been checked out into the
  15. # current directory.
  16. #
  17. # This script could be more parameterized but it doesn't seem worth the
  18. # effort and complexity.  For example, the fact that there are three
  19. # disks generated is explicit in several places in the script, instead
  20. # of just in the definitions.
  21. #
  22. # This script could be done over as a MakeFile so that it's easy to only
  23. # redo the steps that are actually needed.
  24.  
  25.  
  26. # -------------------------------------------------------------------------------------------
  27. # Definitions
  28. # -------------------------------------------------------------------------------------------
  29.  
  30. Set Here            "`Directory`"                    # Main directory.
  31.  
  32. Set ExternalPiecesDir "{Here}ExternalPieces:"        # Location of files we didn't build.
  33.  
  34. Set AssemblyDir        "{Here}MexicanSpanishTTSAssembly:" # Holds intermediate working files.
  35.  
  36. Set NetInstallDir    "{Here}Mexican Spanish TTS:"    # Where the results go.
  37.  
  38. Set ScriptName        "Mexican TTS Install Script"    # Result installer script.
  39.  
  40. Set Commands         "{Commands},{ExternalPiecesDir}" # There are some tools we use.
  41.  
  42.  
  43. # The names of the folder corresponding to each result floppy.
  44. # These names must match those in a .r file as well.
  45.  
  46. Set Disk1Dir        "{NetInstallDir}Mexican TTS 1:"    # Folders for each result disk.
  47. Set Disk2Dir        "{NetInstallDir}Mexican TTS 2:"
  48. Set Disk3Dir        "{NetInstallDir}Mexican TTS 3:"
  49.  
  50.  
  51. # The names of the files (which have been copied to the assembly area) to include
  52. # in each compressed package.
  53. # These names must match those in a .r file as well.
  54.  
  55. # Catalina.rsrc2 is added separately to Tome 1.
  56. Set Tome1Files        "∂"{AssemblyDir}MacinTalk Español Mexicano∂"    ∂
  57.                      ∂"{AssemblyDir}Speech Manager∂"                ∂
  58.                      ∂"{AssemblyDir}Speech∂"                        "
  59.                     
  60. # Tome 2 has Catalina.rsrc1, done specially.
  61.  
  62. Set Tome3Files        "∂"{AssemblyDir}Carlos∂"                        "
  63.  
  64.  
  65. # The names of the compressed packages; these appear on the result disks.
  66. # These names must match those in a .r file as well.
  67.  
  68. Set Tome1Name        "Mexican Spanish TTS Tome 1"
  69. Set Tome2Name        "Mexican Spanish TTS Tome 2"
  70. Set Tome3Name        "Mexican Spanish TTS Tome 3"
  71.  
  72.  
  73. Set ScriptOnly        0                                # Assume build everything.
  74.  
  75.  
  76. # -------------------------------------------------------------------------------------------
  77. # Arguments
  78. # -------------------------------------------------------------------------------------------
  79.  
  80. If {#} >= 1  &&  "{1}" == "-s"
  81.     Set ScriptOnly 1
  82.     Shift
  83. End
  84.  
  85. If {#} != 1
  86.     Echo "### Argument error.  Syntax: {0} [-s] <files directory>"
  87.     Echo "###   -s                 Rebuild script only (don't rebuild files)"
  88.     Echo "###   <files directory>  Location of files to be installed"
  89.     Exit 1
  90. End
  91.  
  92.  
  93. # Convert the already built pieces directory to a full path name.  The standard format
  94. # makes using the variable much easier.
  95.  
  96. Set BuiltPiecesDir `Files -f -o -d -i "{1}"`
  97.  
  98.  
  99. # -------------------------------------------------------------------------------------------
  100. # Build the script
  101. # -------------------------------------------------------------------------------------------
  102.  
  103. Make -f "Installer Script.make" "{ScriptName}" -d For800K=1 > Make.out
  104. Execute Make.out
  105.  
  106.  
  107. # -------------------------------------------------------------------------------------------
  108. # Set up folder structure
  109. #
  110. # We really need to start with a clean slate because various tools will add to existing
  111. # files which really messes things up.
  112. # -------------------------------------------------------------------------------------------
  113.  
  114. If ! {ScriptOnly}
  115.     For dir in "{AssemblyDir}" "{NetInstallDir}" "{Disk1Dir}" "{Disk2Dir}" "{Disk3Dir}"
  116.         Delete -i -y "{dir}"
  117.         NewFolder "{dir}"
  118.     End
  119. End
  120.  
  121.  
  122. # -------------------------------------------------------------------------------------------
  123. # Copy built pieces to assembly area
  124. # -------------------------------------------------------------------------------------------
  125.  
  126. Duplicate -y "{ScriptName}"                                    "{AssemblyDir}"
  127.  
  128. If ! {ScriptOnly}
  129.     Duplicate -y "{BuiltPiecesDir}MacinTalk Español Mexicano"    "{AssemblyDir}"
  130.     Duplicate -y "{BuiltPiecesDir}Speech Manager"                "{AssemblyDir}"
  131.     Duplicate -y "{BuiltPiecesDir}Speech"                        "{AssemblyDir}"
  132.     Duplicate -y "{BuiltPiecesDir}Carlos"                        "{AssemblyDir}"
  133.     Duplicate -y "{BuiltPiecesDir}Catalina"                        "{AssemblyDir}"
  134.     Duplicate -y "{BuiltPiecesDir}Using Mexican Spanish TTS"    "{AssemblyDir}"
  135.     Duplicate -y "{BuiltPiecesDir}MexicanSpanishDefault.rsrc"    "{AssemblyDir}"
  136. End
  137.  
  138.  
  139. # -------------------------------------------------------------------------------------------
  140. # Copy non-built pieces to assembly area
  141. # -------------------------------------------------------------------------------------------
  142.  
  143. If ! {ScriptOnly}
  144.     Duplicate -y "{ExternalPiecesDir}SimpleText"                "{AssemblyDir}"
  145.     Duplicate -y "{ExternalPiecesDir}Installer"                    "{AssemblyDir}"
  146. End
  147.  
  148.  
  149. # -------------------------------------------------------------------------------------------
  150. # Set versions and dates
  151. # -------------------------------------------------------------------------------------------
  152.  
  153. # Hack for now.  Really need to use the SCM tools to do this.
  154.  
  155. If ! {ScriptOnly}
  156.     Echo "Include ∂"{AssemblyDir}MacinTalk Español Mexicano∂" ∂'vers∂';" ∂
  157.         | Rez -o MexicanTTSVersions.rsrc -t 'rsrc' -c 'RSED'    # Must be in different directory.
  158.         
  159.     For file in `Files -f -o -s -r "{AssemblyDir}"`
  160.         Echo "Include ∂"MexicanTTSVersions.rsrc∂";" ∂
  161.             | Rez -a -o "{file}"
  162.         SetFile -d . -m . "{file}"
  163.     End
  164. End
  165.  
  166. If {ScriptOnly}
  167.     Echo "Include ∂"MexicanTTSVersions.rsrc∂";" ∂
  168.         | Rez -a -o "{AssemblyDir}{ScriptName}"
  169.     SetFile -d . -m . "{AssemblyDir}{ScriptName}"
  170. End
  171.  
  172.  
  173. # -------------------------------------------------------------------------------------------
  174. # Split files
  175. #
  176. # The split size needs to be hand tuned for each file to make maximum use of the
  177. # space on a floppy.  This is because the file is compressed after splitting, so
  178. # you have to guess what the compressed size will be.
  179. #
  180. # We need to set the file type and creator of the split pieces back to the
  181. # the original file's type and creator to get around a problem when
  182. # running ScriptCheck.  When ScriptCheck tries to get the version of the
  183. # file to fill in in the 'infa' it (or the atom extender) thinks it can't find
  184. # the file because the type and creator or wrong.  Oddly, there is no problem
  185. # getting the file's size though.  Also, we have to copy the 'vers' 1 resource
  186. # to the split pieces so that there is a version for ScriptCheck to find.
  187. # -------------------------------------------------------------------------------------------
  188.  
  189. If ! {ScriptOnly}
  190.     FileAndRsrcSplitterTool "{AssemblyDir}Catalina" -s 810000
  191.     SetFile -t 'ttvf' -c 'cami' "{AssemblyDir}Catalina.rsrc1"
  192.     SetFile -t 'ttvf' -c 'cami' "{AssemblyDir}Catalina.rsrc2"
  193.     Echo "Include ∂"{AssemblyDir}Catalina∂" 'vers' (1);" ∂
  194.             | Rez -a -o "{AssemblyDir}Catalina.rsrc1"
  195.     Echo "Include ∂"{AssemblyDir}Catalina∂" 'vers' (1);" ∂
  196.             | Rez -a -o "{AssemblyDir}Catalina.rsrc2"
  197. End
  198.  
  199.  
  200. # -------------------------------------------------------------------------------------------
  201. # Build Tomes
  202. # -------------------------------------------------------------------------------------------
  203.  
  204. If ! {ScriptOnly}
  205.  
  206.     # Tome 1
  207.     
  208.     Delete -i "{AssemblyDir}{Tome1Name}"
  209.     For file in {Tome1Files} 
  210.         Echo "# Compressing ∂"{file}∂"…"
  211.         InstaCompOneTool "{file}" -o "{AssemblyDir}{Tome1Name}"
  212.     End
  213.     
  214.     Echo "# Compressing ∂"{AssemblyDir}Catalina.rsrc2∂"…"
  215.     InstaCompOneTool -e -f "Catalina" "{AssemblyDir}Catalina.rsrc2"  -o "{AssemblyDir}{Tome1Name}"
  216.  
  217.     Echo "Include ∂"{ExternalPiecesDir}Tome Resources∂" not 'ckid';" ∂
  218.         | Rez -a -o "{AssemblyDir}{Tome1Name}"            # Error message for double-click on tome.
  219.     SetFile -a C -c kakc -t idcp "{AssemblyDir}{Tome1Name}"
  220.  
  221.     Echo "Include ∂"{AssemblyDir}MexicanSpanishDefault.rsrc∂" 'ttsp' (1);"  ∂
  222.             | Rez -a -o "{AssemblyDir}{Tome1Name}"
  223.     
  224.     
  225.     # Tome 2
  226.     
  227.     Delete -i "{AssemblyDir}{Tome2Name}"
  228.     Echo "# Compressing ∂"{AssemblyDir}Catalina.rsrc1∂"…"
  229.     InstaCompOneTool -e -f "Catalina" "{AssemblyDir}Catalina.rsrc1"  -o "{AssemblyDir}{Tome2Name}"
  230.     Echo "Include ∂"{ExternalPiecesDir}Tome Resources∂" not 'ckid';" ∂
  231.         | Rez -a -o "{AssemblyDir}{Tome2Name}"            # Error message for double-click on tome.
  232.     SetFile -a C -c kakc -t idcp "{AssemblyDir}{Tome2Name}"
  233.     
  234.     
  235.     # Tome 3
  236.     
  237.     Delete -i "{AssemblyDir}{Tome3Name}"
  238.     For file in {Tome3Files} 
  239.         Echo "# Compressing ∂"{file}∂"…"
  240.         InstaCompOneTool "{file}" -o "{AssemblyDir}{Tome3Name}"
  241.     End
  242.     Echo "Include ∂"{ExternalPiecesDir}Tome Resources∂" not 'ckid';" ∂
  243.         | Rez -a -o "{AssemblyDir}{Tome3Name}"            # Error message for double-click on tome.
  244.     SetFile -a C -c kakc -t idcp "{AssemblyDir}{Tome3Name}"
  245. End
  246.  
  247.  
  248. # -------------------------------------------------------------------------------------------
  249. # Create net install
  250. # -------------------------------------------------------------------------------------------
  251.  
  252. Duplicate -y "{AssemblyDir}{ScriptName}"                    "{NetInstallDir}"
  253. #Duplicate -y "{AssemblyDir}{ScriptName}"                    "{Disk1Dir}"
  254.  
  255. If ! {ScriptOnly}
  256.     Duplicate -y "{AssemblyDir}Installer"                        "{NetInstallDir}"
  257.     Duplicate -y "{AssemblyDir}Using Mexican Spanish TTS"        "{NetInstallDir}"
  258.     
  259.     Duplicate -y "{AssemblyDir}Installer"                        "{Disk1Dir}"
  260.     Duplicate -y "{AssemblyDir}{Tome1Name}"                        "{Disk1Dir}"
  261.     Duplicate -y "{AssemblyDir}SimpleText"                        "{Disk1Dir}"
  262.     Duplicate -y "{AssemblyDir}Using Mexican Spanish TTS"        "{Disk1Dir}"
  263.     
  264.     Duplicate -y "{AssemblyDir}{Tome2Name}"                        "{Disk2Dir}"
  265.     
  266.     Duplicate -y "{AssemblyDir}{Tome3Name}"                        "{Disk3Dir}"
  267. End
  268.  
  269.  
  270. # -------------------------------------------------------------------------------------------
  271. # Run ScriptCheck
  272. #
  273. # Besides checking the script and files also fills in some info in the script and so is an
  274. # essential step.
  275. #
  276. # Ignore the error messages about the 'icmt's not being referenced; the messages
  277. # are spurious.
  278. # -------------------------------------------------------------------------------------------
  279.  
  280. Duplicate -y "{ExternalPiecesDir}InstaCompOneSCExt.rsrc" "{NetInstallDir}{ScriptName}.scx"
  281. Directory "{NetInstallDir}"                                # ScriptCheck can't take long names.
  282. ScriptCheck -h -a -d "{ScriptName}"
  283. Directory "{Here}"
  284. Duplicate -y "{NetInstallDir}{ScriptName}" "{Disk1Dir}"
  285. Delete "{NetInstallDir}{ScriptName}.scx"
  286.